import { Callout } from "nextra/components";
import VideoEmbed from "../../components/video-embed";

# Wetland Segmentation

> Identify wetland areas in satellite imagery

<VideoEmbed
  src="https://geobase-docs.s3.amazonaws.com/geobase-ai-assets/wetland-segmentation.mp4"
  title="Wetland Segmentation Demo"
/>

<div style={{ textAlign: 'center', marginTop: '1rem' }}>
  <a 
    href="https://docs.geobase.app/geoai-live/tasks/wetland-segmentation" 
    target="_blank" 
    rel="noopener noreferrer"
    style={{ 
      display: 'inline-flex', 
      alignItems: 'center', 
      gap: '0.5rem',
      padding: '0.5rem 1rem',
      backgroundColor: '#3b82f6',
      color: 'white',
      textDecoration: 'none',
      borderRadius: '0.375rem',
      fontWeight: '500',
      transition: 'background-color 0.2s'
    }}
    className="live-demo-button"
  >
    🚀 Try Live Demo
  </a>
</div>

<style jsx>{`
  .live-demo-button:hover {
    background-color: #2563eb !important;
  }
`}</style>

<div style={{ textAlign: 'center', marginTop: '0.5rem' }}>
  <a 
    href="https://huggingface.co/geobase/wetland-segmentation" 
    target="_blank" 
    rel="noopener noreferrer"
    style={{ 
      fontSize: '0.875rem',
      color: '#6b7280',
      textDecoration: 'none'
    }}
  >
    🤗 View Model on Hugging Face
  </a>
</div>

## Quick Start

```typescript
import { geoai } from "geoai";

// Initialize pipeline
const pipeline = await geoai.pipeline(
  [{ task: "wetland-segmentation" }],
  providerParams
);

// Run segmentation
const result = await pipeline.inference({
  inputs: { polygon: myPolygon },
  mapSourceParams: {
    zoomLevel: 16,
    bands: [1, 2, 3, 4], // RGB + NIR required
  },
});

console.log(`Identified ${result.detections.features.length} wetland areas`);
```

<Callout type="warning" emoji="🌊">
  **Requires 4-band imagery:** This model needs RGB + NIR bands and will not
  work with standard 3-band RGB imagery
</Callout>

## Parameters

### Map Source

```typescript
mapSourceParams: {
  zoomLevel: 16,           // 15-17 recommended for wetlands
  bands: [1, 2, 3, 4]     // Red, Green, Blue, NIR (all required)
}
```

## Output

Returns GeoJSON with identified wetland polygons:

```typescript
{
  detections: {
    type: "FeatureCollection",
    features: [
      {
        geometry: { /* wetland boundary polygon */ },
        properties: {}
      }
    ]
  }
}
```
